<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>jQuery的类数组对象结构</title>
    <script src="../lib/jquery.js"></script>
</head>
<body>

<script>

    //类一：
    function ajQuery() {
        this.name = 'jQuery';
        this.sayName = function() {
            return this.name
        }
    }
    var a = new ajQuery()
    var b = new ajQuery()
    var c = new ajQuery()



    // 类二
    function ajQuery() {
        this.name = 'jQuery'
    }
    ajQuery.prototype = {
        sayName: function() {
            return this.name
        }
    }
    var a = new ajQuery()
    var b = new ajQuery()
    var c = new ajQuery()


    // jQuery的写法
    var $jQuery = function(selector, context) {
        return new $jQuery.fn.init(selector, context);
    }

    $jQuery.fn = $jQuery.prototype = {
        init: function() {
            this.name = 'aaron'
            return this;
        },
        constructor: $jQuery
    }

    var $a = $jQuery();

    show('$jQuery的调用')
    show($a);
</script>
</body>
</html>